3.1.14 \(\int \sec ^m(c+d x) (-\frac {C m}{1+m}+C \sec ^2(c+d x)) \, dx\) [14]

Optimal. Leaf size=26 \[ \frac {C \sec ^{1+m}(c+d x) \sin (c+d x)}{d (1+m)} \]

[Out]

C*sec(d*x+c)^(1+m)*sin(d*x+c)/d/(1+m)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.034, Rules used = {4128} \begin {gather*} \frac {C \sin (c+d x) \sec ^{m+1}(c+d x)}{d (m+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^m*(-((C*m)/(1 + m)) + C*Sec[c + d*x]^2),x]

[Out]

(C*Sec[c + d*x]^(1 + m)*Sin[c + d*x])/(d*(1 + m))

Rule 4128

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[A*Cot[e
+ f*x]*((b*Csc[e + f*x])^m/(f*m)), x] /; FreeQ[{b, e, f, A, C, m}, x] && EqQ[C*m + A*(m + 1), 0]

Rubi steps

\begin {align*} \int \sec ^m(c+d x) \left (-\frac {C m}{1+m}+C \sec ^2(c+d x)\right ) \, dx &=\frac {C \sec ^{1+m}(c+d x) \sin (c+d x)}{d (1+m)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.22, size = 26, normalized size = 1.00 \begin {gather*} \frac {C \sec ^{1+m}(c+d x) \sin (c+d x)}{d (1+m)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^m*(-((C*m)/(1 + m)) + C*Sec[c + d*x]^2),x]

[Out]

(C*Sec[c + d*x]^(1 + m)*Sin[c + d*x])/(d*(1 + m))

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.85, size = 512, normalized size = 19.69

method result size
risch \(-\frac {i C \left (2^{m} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{-m} \left ({\mathrm e}^{i \left (\Re \left (d x \right )+\Re \left (c \right )\right )}\right )^{m} {\mathrm e}^{-m \Im \left (d x \right )-m \Im \left (c \right )} {\mathrm e}^{-\frac {i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{3} \pi m}{2}} {\mathrm e}^{\frac {i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{i \left (d x +c \right )}\right ) \pi m}{2}} {\mathrm e}^{\frac {i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \pi m}{2}} {\mathrm e}^{-\frac {i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \mathrm {csgn}\left (i {\mathrm e}^{i \left (d x +c \right )}\right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \pi m}{2}} {\mathrm e}^{2 i d x} {\mathrm e}^{2 i c}-2^{m} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{-m} \left ({\mathrm e}^{i \left (\Re \left (d x \right )+\Re \left (c \right )\right )}\right )^{m} {\mathrm e}^{-\frac {m \left (i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{3} \pi -i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{i \left (d x +c \right )}\right ) \pi -i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \pi +i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \mathrm {csgn}\left (i {\mathrm e}^{i \left (d x +c \right )}\right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \pi +2 \Im \left (c \right )+2 \Im \left (d x \right )\right )}{2}}\right )}{\left (1+m \right ) d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}\) \(512\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^m*(-C*m/(1+m)+C*sec(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

-I*C/(1+m)/d/(exp(2*I*(d*x+c))+1)*(2^m/((exp(2*I*(d*x+c))+1)^m)*exp(I*(Re(d*x)+Re(c)))^m*exp(-m*Im(d*x)-m*Im(c
))*exp(-1/2*I*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3*Pi*m)*exp(1/2*I*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*
x+c))+1))^2*csgn(I*exp(I*(d*x+c)))*Pi*m)*exp(1/2*I*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2
*I*(d*x+c))+1))*Pi*m)*exp(-1/2*I*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*exp(I*(d*x+c)))*csgn(I/(ex
p(2*I*(d*x+c))+1))*Pi*m)*exp(2*I*d*x)*exp(2*I*c)-2^m/((exp(2*I*(d*x+c))+1)^m)*exp(I*(Re(d*x)+Re(c)))^m*exp(-1/
2*m*(I*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3*Pi-I*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I
*exp(I*(d*x+c)))*Pi-I*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1))*Pi+I*csgn(I*e
xp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*exp(I*(d*x+c)))*csgn(I/(exp(2*I*(d*x+c))+1))*Pi+2*Im(c)+2*Im(d*x)))
)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 304 vs. \(2 (26) = 52\).
time = 0.65, size = 304, normalized size = 11.69 \begin {gather*} -\frac {2^{m} C \cos \left (-{\left (d x + c\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) \sin \left (2 \, d x + 2 \, c\right ) - 2^{m} C \cos \left (-{\left (d x + c\right )} m + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) \sin \left (2 \, d x + 2 \, c\right ) + {\left (2^{m} C \cos \left (2 \, d x + 2 \, c\right ) + 2^{m} C\right )} \sin \left (-{\left (d x + c\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) - {\left (2^{m} C \cos \left (2 \, d x + 2 \, c\right ) + 2^{m} C\right )} \sin \left (-{\left (d x + c\right )} m + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right )}{{\left ({\left (m + 1\right )} \cos \left (2 \, d x + 2 \, c\right )^{2} + {\left (m + 1\right )} \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, {\left (m + 1\right )} \cos \left (2 \, d x + 2 \, c\right ) + m + 1\right )} {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, m} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^m*(-C*m/(1+m)+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

-(2^m*C*cos(-(d*x + c)*(m + 2) + m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))*sin(2*d*x + 2*c) - 2^m*C*c
os(-(d*x + c)*m + m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))*sin(2*d*x + 2*c) + (2^m*C*cos(2*d*x + 2*c
) + 2^m*C)*sin(-(d*x + c)*(m + 2) + m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) - (2^m*C*cos(2*d*x + 2*
c) + 2^m*C)*sin(-(d*x + c)*m + m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))/(((m + 1)*cos(2*d*x + 2*c)^
2 + (m + 1)*sin(2*d*x + 2*c)^2 + 2*(m + 1)*cos(2*d*x + 2*c) + m + 1)*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2
+ 2*cos(2*d*x + 2*c) + 1)^(1/2*m)*d)

________________________________________________________________________________________

Fricas [A]
time = 2.26, size = 33, normalized size = 1.27 \begin {gather*} \frac {C \frac {1}{\cos \left (d x + c\right )}^{m} \sin \left (d x + c\right )}{{\left (d m + d\right )} \cos \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^m*(-C*m/(1+m)+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

C*(1/cos(d*x + c))^m*sin(d*x + c)/((d*m + d)*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {C \left (\int \left (- m \sec ^{m}{\left (c + d x \right )}\right )\, dx + \int \sec ^{2}{\left (c + d x \right )} \sec ^{m}{\left (c + d x \right )}\, dx + \int m \sec ^{2}{\left (c + d x \right )} \sec ^{m}{\left (c + d x \right )}\, dx\right )}{m + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**m*(-C*m/(1+m)+C*sec(d*x+c)**2),x)

[Out]

C*(Integral(-m*sec(c + d*x)**m, x) + Integral(sec(c + d*x)**2*sec(c + d*x)**m, x) + Integral(m*sec(c + d*x)**2
*sec(c + d*x)**m, x))/(m + 1)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^m*(-C*m/(1+m)+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

integrate((C*sec(d*x + c)^2 - C*m/(m + 1))*sec(d*x + c)^m, x)

________________________________________________________________________________________

Mupad [B]
time = 2.86, size = 42, normalized size = 1.62 \begin {gather*} \frac {C\,\sin \left (2\,c+2\,d\,x\right )\,{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^m}{d\,\left (\cos \left (2\,c+2\,d\,x\right )+1\right )\,\left (m+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1/cos(c + d*x))^m*(C/cos(c + d*x)^2 - (C*m)/(m + 1)),x)

[Out]

(C*sin(2*c + 2*d*x)*(1/cos(c + d*x))^m)/(d*(cos(2*c + 2*d*x) + 1)*(m + 1))

________________________________________________________________________________________